package com.yzyz.web.controller.visitor.route.more;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.yzyz.bean.route.RouteGroupBean;
import com.yzyz.data.CacheFactory;
import com.yzyz.utils.ValidateUtils;

/**
 * 查看更多的行程
 * @author Administrator
 *
 */
public class ViewMoreController extends AbstractController {

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		if(ValidateUtils.isNull(request.getParameter("routeGroupId"))){
			ModelAndView mv = new ModelAndView("/Error/error.jsp");
			mv.addObject("errorMsg", "对不起！您所查看的信息不存在。");
			return mv;
		}
		int routeGroupId = Integer.valueOf(request.getParameter("routeGroupId"));
		RouteGroupBean routeGroup = CacheFactory.getRouteGroupStore().getRouteGroup(routeGroupId);
		ModelAndView mv = new ModelAndView("/Route/More/viewMore.jsp");
		mv.addObject("routeGroup", routeGroup);
		return mv;
	}

}
